var d = function (name) { return document.getElementById(name); };

function toggleRegion(event) {
	var container = d("container");
	var toggler = d("toggler");
	var dummyCheck = d("do-dummy-update");

	if (container.style.display == "none") {
		container.style.display="block";
		toggler.innerHTML = "Hide region";
	} else {
		container.style.display = "none";
		toggler.innerHTML = "Show region";
	}
	// the following is only to demonstrate how to force an update
	if (dummyCheck.checked) {
		pointlessUpdate();
	}
}

function pointlessUpdate() {
	var wrapper = d("wrapper");
	var dummy = wrapper.appendChild(document.createTextNode("dummy"));
	wrapper.removeChild(dummy);
}
